/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package snapserv;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

/**
 *
 * @author Radexito
 */
public class SnapServ {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        String url = "http://findsnapchatfriends.com/find/dirty-snapchat-girls-age-18-to-33?page=";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int i = 0;
        
        System.out.println("***********************************");
        System.out.println("*********snapchat name scrper******");
        System.out.println("***********************************");
        System.out.println("");
        System.out.println("How many files do you want to download (number only please):");
        try {
            int howmany = Integer.parseInt(br.readLine());
            while(i < howmany){
                //System.out.println("URL: " + url + i);
                String url1 = url + i;
                Document doc = Jsoup.connect(url1).timeout(30000).get();
                int j = 0;
                while(j < doc.select("div.username").size()){
                    System.out.println(doc.select("div.username").get(j).text());
                    j++;
                }
            i++;
            }
        } catch (IOException ex) {
            Logger.getLogger(SnapServ.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
    }
    
}

